YUI.add('xWidget-input-file', function( Y ){	
		
		var defConfig = {
			targetId:''
		};
		
		var inputFile = function(){
		};

		Y.mix( inputFile.prototype, {
			init:function( userConfig ){
				this._config = ET.merge( defConfig, userConfig || {} );
				this.bindUI();

				return this;
			},
			bindUI:function(){
				this._dTarget = Y.DOM.get( this._config.targetId );
			},
			clearValue:function(){
				var newInput = this.cloneInput(),
						d				 = this._dTarget;

				this._dTarget = newInput;
				newInput.style.display = 'none';
				d.parentNode.insertBefore( newInput, d );
				newInput.style.display = '';

				d.parentNode.removeChild( d );				
			},
			cloneInput:function(){
				var newInput = document.createElement('input');
				newInput.type = this._dTarget.type;
				newInput.className = this._dTarget.className;
				newInput.size = this._dTarget.size;
				return newInput;
			},
			getValue:function(){
				return this._dTarget.value;
			}
		});
		
		Y.xWidget.inputFile = inputFile;
});
